package com.cuit.washneedshake.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cuit.washneedshake.model.entity.NationalTrends;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface NationalTrendsMapper extends BaseMapper<NationalTrends> {

    /**
     * 获取累计确诊
     *
     * @return
     */
    @Select("select confirmed from national_trends where id = ${s_id}")
    Integer getConfirmedById(int s_id);

    @Select("select SUM(confirmed) from national_trends")
    Integer getConfirmedSum();

    /**
     * 获取累计治愈
     */
    @Select("select cured from national_trends where id = ${s_id}")
    Integer getCuredById(int s_id);

    @Select("select SUM(cured) from national_trends")
    Integer getCuredSum();
    /**
     * 获取累计死亡
     */
    @Select("select death from national_trends where id = ${s_id}")
    Integer getDeathById(int s_id);

    @Select("select SUM(death) from national_trends")
    Integer getDeathSum();


    @Select("select date from national_trends where id = ${s_id}")
    Date getDate(int s_id);
}




